package com.hschinese.pronunciation.model;

import com.hschinese.pronunciation.bean.AnonymityBean;

import org.json.JSONException;
import org.json.JSONObject;

/**
 * Created by wo on 2015/11/13.
 */
public class AnonymityModel {
    private static AnonymityModel mInstance = null;
    private AnonymityModel() {
    }

    public static AnonymityModel getInstance() {
        synchronized (AnonymityModel.class) {
            if (mInstance == null) {
                mInstance = new AnonymityModel();
            }
            return mInstance;
        }
    }

    public AnonymityBean getAnonymityObj(JSONObject json) throws JSONException {
        AnonymityBean info = new AnonymityBean();
        info.setNickname(json.getString("Nickname"));
        info.setEmail(json.getString("Email"));
        info.setEnddate(json.getString("Enddate"));
        info.setUid(json.getString("Uid"));
        info.setAvatars(json.getString("Avatars"));
        return info;
    }
}
